/* Copyright (c) 2024 Qualcomm Technologies International, Ltd. */
/*   %%version */
/**
 * \file
 * Interrupt levels, included by both Kalimba assembler and C code so can
 * only use defines not typedefs or enums.
 */
#ifndef INT_LEVELS_H
#define INT_LEVELS_H

/**
 * Defines used for specifying the interrupt priority level.
 * These values shouldn't be used directly. Instead the abstractions
 * below such as \c INT_LEVEL_FG should be used.
 */
#define INT_PRIORITY_LOW        (1)
#define INT_PRIORITY_MED        (2)
#define INT_PRIORITY_HIGH       (3)


/**
 * Priority level to use for handling different interrupt sources on P1.
 *
 * On P1 keep the interrupt priority levels the way they have always been since
 * customers may have used lower ones in their own code. Also when P1 handles
 * a panic from P0 it does very little so EXCEPTIONs don't need to go off.
 */
#define INT_LEVEL_FG            (INT_PRIORITY_MED)
#define INT_LEVEL_HOSTIO        (INT_PRIORITY_MED)
#define INT_LEVEL_PANIC         (INT_PRIORITY_HIGH)
#define INT_LEVEL_EXCEPTION     (INT_PRIORITY_HIGH)


/**
 * Used by block_interrupts() to block all interrupts below this priority.
 * ie on both P0 and P1, panic IPCs from the other CPU and EXCEPTIONs can go
 * off (neither of which ever return) while interrupts are disabled.
 *
 * block_interrupts_and_exceptions() is used solely by the Flash driver
 * to disable everything.
 */
#define INT_LEVEL_BLOCK         (INT_LEVEL_PANIC)

#endif /* INT_LEVELS_H */
